package com.xrj4j.car_news.api

import com.xrj4j.car_news.model.BrandItem
import com.xrj4j.car_news.model.CarItem
import com.xrj4j.car_news.model.LogoItem
import com.xrj4j.car_news.model.ResultDto
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Query

interface CarApi {
    companion object {
        const val key = "ee2334ca4a3d4445873bf79962ddc28b"
        const val baseUrl = "http://apis.juhe.cn/cxdq/"
    }

    @GET("brand")
    fun getCarLogo(@Query("key") key: String,
                   @Query("first_letter") firstLetter: String):Call<ResultDto<LogoItem>>

    @GET("series")
    fun getBrandList(@Query("key") key: String,
                     @Query("brandid") brandId: String?,
                     @Query("levelid") levelId: String?):Call<ResultDto<BrandItem>>

    @GET("models")
    fun getCarModelList(@Query("key") key: String,
                        @Query("series_id") series_id: String?,
                        @Query("year") year: String?):Call<ResultDto<CarItem>>
}